function [ii, jj] = getLayer(net_content, layer_nmae)

head = 'layer\s*\{';
tail = '\s*}';

unit = '(\s*\S+\s*:\s*\S+)';
% unit = '(\s*\S+\s*:[^\n]*)';
block = ['(\s*\S+\s*(:?)\s*{(' unit ')*\s*})'];
supblock = ['(\s*\S+\s*{(' unit '|' block ')*\s*})'];

% Attention: it is very important to organize the patterns from big to small
% complex = ['(' unit '|' block '|' supblock ')*']; % xxxxxxxx
complex = ['(' supblock '|' block '|' unit ')*']; 

name_unit = sprintf('(\\s*name\\s*:\\s*"%s")', layer_nmae);
% p_name = sprintf('(\\s*name\\s*:\\s*"%s")', 'conv19');

[ii, jj] = regexp(net_content, [head complex name_unit complex tail], 'ignorecase');

% clc
% net_text(ii(1) : jj(1))
% net_text(ii(2) : jj(2))
return